{% include 'header.html' %}
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">操作日志</div>
          <div class="layui-card-body">
            <table id="demo" lay-filter="test"></table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script>
layui.use('table', function(){
  var table = layui.table;
  var cols;
  // 发起ajax请求
  $.ajax({
    url: '/log_manage/actor_log/cols',
    method: 'GET',
    success: function(response) {
      // 将获取到的数据赋值给全局变量
      obj = JSON.parse(response)
      cols = [obj.data]
      console.log("===================================")
      console.log(cols); // 打印全局变量的值
      //第一个实例
      table.render({
      elem: '#demo'

      ,url: '/log_manage/actor_log/page' //数据接口
      ,page: true //开启分页
      ,cols: cols
      });
    },
    error: function(error) {
      console.log(error);
    }
  });
});
  </script>
{% include 'footer.html' %}